'use strict';
const Controller = require('egg').Controller;
class ChapterController extends Controller {
    async getInfo() {
        const { ctx } = this;
        let bid = this.ctx.query.n1
        let sql = `SELECT * FROM chapter WHERE bookId = '${bid}'`,
            redata = await this.app.mysql.query(sql),
            sql2 = `SELECT * FROM book WHERE bookID = ${bid}`,
            res = await this.app.mysql.query(sql2),
            bName = res[0].name1
        ctx.body = [redata,bName]
    }
}

module.exports = ChapterController;
